/** Project : Sticky Notes Plus */
/** Author  : Sainagakishore Srikantham */
/** Email   : ssn.kishore@gmail.com */

/** File    : StickyNotesUIMgr.h */
/** Purpose : This file contains the definition for the class CStickyNotesUIMgr which is primarily responsible to deal
              with all the UI componens of the project */

#ifndef CSTICKYNOTESUIMGR_H
#define CSTICKYNOTESUIMGR_H

#include <QSystemTrayIcon>
#include <QDialog>

QT_BEGIN_NAMESPACE
class QMenu;
class QAction;
class QIcon;
QT_END_NAMESPACE

class CStickyNotesUIMgr : public QDialog
{
    Q_OBJECT
public:
    /** Registers the "actions" or signals and slots associated with different UI components */
    void RegisterActions();

    /** Constructor of the class */
    CStickyNotesUIMgr();

    /** Overriden function that enables / disables menu items from the systray context menu */
    void setVisible(bool visible);

    /** Destructor of the class */
    ~CStickyNotesUIMgr();

private slots:
    /** Called when the user clicks on the systray icon */
    void IconActivated(QSystemTrayIcon::ActivationReason aReason);

    /** Called when the 'Hide All Notes' item from the systray context menu is selected */
    void HideAllTriggered();

    /** Called when the 'Show All Notes' item from the systray context menu is selected */
    void ShowAllTriggered();

    /** Called when the 'Donate' item from the systray context menu is selected */
    void DonateTriggered();

    /** Called when the 'Preferences' item from the systray context menu is selected */
    void PreferencesTriggered();

    /** Called when the 'Day Note' item from the systray context menu is selected */
    void AddDayNoteTriggered();

    /** Called when the 'Date Note' item from the systray context menu is selected */
    void AddDateNoteTriggered();

    /** Called when the 'Generic' item from the systray context menu is selected */
    void AddGenericTriggered();

    /** Called when the 'Quit' item from the systray context menu is selected */
    void SaveAndQuit();

private:
    /** Displays a pop up containing the login information of the user */
    void DisplayLoginInfo();

private:
    /** Instance of the framework class needed to show a "system tray" icon */
    QSystemTrayIcon* iSystemTrayIcon;

    /** Instance of the actual ICON object */
    QIcon* iTrayIcon;

    /** The context menu associated with the system tray */
    QMenu* iSystemTrayMenu;
    QMenu* iAddNoteMenu;

    /** "Action" items associated with every item of the context menu */
    QAction* iDonateAction;
    QAction* iShowAllNotes;
    QAction* iHideAllNotes;
    QAction* iQuitAction;
    QAction* iPreferencesAction;

    /** Actions associated with the submenu 'Add Note' */
    QAction* iAddDateNoteAction;
    QAction* iAddDayNoteAction;
    QAction* iAddGenericNoteAction;
};

#endif // CSTICKYNOTESUIMGR_H
